﻿using System.ComponentModel.DataAnnotations;

namespace JNPF.Basics.Models.DataInterface.Dtos
{
    /// <summary>
    /// 数据接口新增
    /// </summary>
    public class DataInterfaceCrInput
    {
        /// <summary>
        /// 接口名称
        /// </summary>
        [Required(ErrorMessage = "接口名称不能为空")]
        public string fullName { get; set; }
        /// <summary>
        /// 分类id
        /// </summary>
        [Required(ErrorMessage = "分类id不能为空")]
        public string categoryId { get; set; }
        /// <summary>
        /// 数据源id
        /// </summary>
        [Required(ErrorMessage = "数据源id不能为空")]
        public string dbLinkId { get; set; }
        /// <summary>
        /// 请求方式
        /// </summary>
        [Required(ErrorMessage = "请求方式不能为空")]
        public string requestMethod { get; set; }
        /// <summary>
        /// 返回类型
        /// </summary>
        [Required(ErrorMessage = "返回类型不能为空")]
        public string responseType { get; set; }
        /// <summary>
        ///排序
        /// </summary>
        [Required(ErrorMessage = "排序不能为空")]
        public long? sortCode { get; set; }
        /// <summary>
        /// 编码
        /// </summary>
        [Required(ErrorMessage = "编码不能为空")]
        public string enCode { get; set; }
        /// <summary>
        /// 状态
        /// </summary>
        [Required(ErrorMessage = "状态不能为空")]
        public int? enabledMark { get; set; }
        /// <summary>
        /// 描述
        /// </summary>
        public string description { get; set; }
        /// <summary>
        /// 查询语句
        /// </summary>
        [Required(ErrorMessage = "查询语句不能为空")]
        public string query { get; set; }

        /// <summary>
        /// 数据类型(1-SQL数据，2-静态数据，3-Api数据)
        /// </summary>
        [Required(ErrorMessage = "数据类型不能为空")]
        public int? dataType { get; set; }

        /// <summary>
        /// 请求参数JSON
        /// </summary>
        [Required(ErrorMessage = "请求参数JSON不能为空")]
        public string requestParameters { get; set; }
        /// <summary>
        /// 接口路径
        /// </summary>
        [Required(ErrorMessage = "接口路径不能为空")]
        public string path { get; set; }
    }
}
